package club.gskj.gulimall.shoppingcart.config;

import club.gskj.gulimall.shoppingcart.interceptor.CartIntercptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    /**
     * 设置 拦截器要拦截的 请求路径
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CartIntercptor())
                // 拦截所有请求
                .addPathPatterns("/**");
    }
}
